package com.societyGames.precedenceExercises
{
	public class NumberConstantExpression implements INumberExpression
	{	
		private var _value:int;
		
		public function NumberConstantExpression(xml:XML)
		{
			if ("@value" in xml)
			{
				this._value = Number(xml.@value);
			}
			else
			{
				throw new ArgumentError("XML missing required attribute value.");
			}
		}
		
		public function toString():String
		{
			return Object(this._value).toString();
		}
		
		//INumberExpression-->
		public function evaluate():Number
		{
			return this._value;	
		}
		//<--INumberExpression
	}
}